package cn.wh.context.support;

import cn.wh.beans.factory.support.DefaultListableBeanFactory;
import cn.wh.beans.factory.xml.XmlBeanDefinitionReader;

/**
 * @Author wanghao
 * @Date 2022-09-20 22:38
 * @Description: TODO
 */
public abstract   class AbstractXmlApplicationContext  extends AbstractRefreshableApplicationContext {

    @Override
    protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) {
        XmlBeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory, this);
        String[] configLocations = getConfigLocations();
        if (null != configLocations){
            beanDefinitionReader.loadBeanDefinitions(configLocations);
        }
    }


    protected abstract String[] getConfigLocations();


}
